package cn.wei.youvierpc.registry;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class LocalRegistry {

    //注册信息存储
    private static final Map<String, Class<?>> serviceMap = new ConcurrentHashMap<>();


    /**
     * 注册服务
     */
    public static void register(String serviceName, Class<?> implClass) {
        serviceMap.put(serviceName, implClass);
    }

    /**
     * 获取服务
     */
    public static Class<?> get(String serviceName) {
        return serviceMap.get(serviceName);
    }

    /**
     * 删除服务
     */
    public static void remove(String serviceName) {
        serviceMap.remove(serviceName);
    }
}
